import ctypes

user32 = ctypes.windll.user32
GetDC = user32.GetDC
gdi32 = ctypes.windll.gdi32
GetPixel = gdi32.GetPixel

hdc = GetDC(None)  # 获取句柄


def get_pixel(x, y):
    c = GetPixel(hdc, x, y)
    return c
